feat: add anchor-evm crate for EVM-based anchoring#742
Merged
Conversation
Add new crate implementing EVM blockchain anchoring for Ceramic streams. - Supports self-anchoring directly to EVM chains without Merkle trees - Implements gas management with dynamic pricing and retry logic - Uses environment variables for RPC endpoints to avoid hardcoded secrets - Includes comprehensive tests for Gnosis Chain integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
smrz2001
added a commit
that referenced
this pull request
Nov 25, 2025
…test Fixes from PR #742 review: - Fix tx_hash_to_cid: wrap hash with Keccak256 code + ETH_TX codec (0x93) instead of re-hashing with SHA2-256 - Fix AnchorProof parameter order: (chain_id, root, tx_hash, tx_type) - Add chain ID validation after connecting to provider - Implement retry logic with exponential backoff - Add wallet balance logging for gas cost tracking - Update default confirmations from 1 to 4 (matching JS implementation) Code cleanup: - Remove unused GasConfig (alloy handles gas estimation automatically) - Remove unused get_root_block function and getRootBlock interface - Consolidate gnosis_test.rs into integration_test.rs Testing: - Add test_cid_to_bytes32_matches_js to verify JS compatibility - Add test_tx_hash_to_cid_matches_js to verify JS compatibility - Add test_anchor_service_with_evm for full AnchorService flow testing (merkle tree building, EVM anchoring, time event creation) Documentation: - Update README with comprehensive test documentation - Document all environment variables for integration tests - Update contract interface to match actual implementation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
56b8598 to
54e2ac2
Compare
smrz2001
added a commit
that referenced
this pull request
Nov 25, 2025
…test Fixes from PR #742 review: - Fix tx_hash_to_cid: wrap hash with Keccak256 code + ETH_TX codec (0x93) instead of re-hashing with SHA2-256 - Fix AnchorProof parameter order: (chain_id, root, tx_hash, tx_type) - Add chain ID validation after connecting to provider - Implement retry logic with exponential backoff - Add wallet balance logging for gas cost tracking - Update default confirmations from 1 to 4 (matching JS implementation) Code cleanup: - Remove unused GasConfig (alloy handles gas estimation automatically) - Remove unused get_root_block function and getRootBlock interface - Consolidate gnosis_test.rs into integration_test.rs Testing: - Add test_cid_to_bytes32_matches_js to verify JS compatibility - Add test_tx_hash_to_cid_matches_js to verify JS compatibility - Add test_anchor_service_with_evm for full AnchorService flow testing (merkle tree building, EVM anchoring, time event creation) Documentation: - Update README with comprehensive test documentation - Document all environment variables for integration tests - Update contract interface to match actual implementation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
54e2ac2 to
1680ec7
Compare
smrz2001
added a commit
that referenced
this pull request
Nov 25, 2025
…test Fixes from PR #742 review: - Fix tx_hash_to_cid: wrap hash with Keccak256 code + ETH_TX codec (0x93) instead of re-hashing with SHA2-256 - Fix AnchorProof parameter order: (chain_id, root, tx_hash, tx_type) - Add chain ID validation after connecting to provider - Implement retry logic with exponential backoff - Add wallet balance logging for gas cost tracking - Update default confirmations from 1 to 4 (matching JS implementation) Code cleanup: - Remove unused GasConfig (alloy handles gas estimation automatically) - Remove unused get_root_block function and getRootBlock interface - Consolidate gnosis_test.rs into integration_test.rs Testing: - Add test_cid_to_bytes32_matches_js to verify JS compatibility - Add test_tx_hash_to_cid_matches_js to verify JS compatibility - Add test_anchor_service_with_evm for full AnchorService flow testing (merkle tree building, EVM anchoring, time event creation) Documentation: - Update README with comprehensive test documentation - Document all environment variables for integration tests - Update contract interface to match actual implementation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1680ec7 to
7a4235e
Compare
…test Fixes from PR #742 review: - Fix tx_hash_to_cid: wrap hash with Keccak256 code + ETH_TX codec (0x93) instead of re-hashing with SHA2-256 - Fix AnchorProof parameter order: (chain_id, root, tx_hash, tx_type) - Add chain ID validation after connecting to provider - Implement retry logic with exponential backoff - Add wallet balance logging for gas cost tracking - Update default confirmations from 1 to 4 (matching JS implementation) Code cleanup: - Remove unused GasConfig (alloy handles gas estimation automatically) - Remove unused get_root_block function and getRootBlock interface - Consolidate gnosis_test.rs into integration_test.rs Testing: - Add test_cid_to_bytes32_matches_js to verify JS compatibility - Add test_tx_hash_to_cid_matches_js to verify JS compatibility - Add test_anchor_service_with_evm for full AnchorService flow testing (merkle tree building, EVM anchoring, time event creation) Documentation: - Update README with comprehensive test documentation - Document all environment variables for integration tests - Update contract interface to match actual implementation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
7a4235e to
c561529
Compare
- Check receipt.status() and return error if transaction reverted - Use ok_or_else() instead of unwrap() for block_number 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
3b895a5 to
978e3a3
Compare
stephhuynh18
approved these changes
Nov 26, 2025
Merged
dav1do
reviewed
Dec 2, 2025
| /// Validate the configuration | ||
| pub fn validate_config(config: &EvmConfig) -> Result<()> { | ||
| if config.private_key.is_empty() { | ||
| return Err(anyhow!("Private key cannot be empty")); |
Collaborator
There was a problem hiding this comment.
nit: anyhow::bail! is a bit nicer and equivalent
| #[tokio::test] | ||
| #[ignore] | ||
| async fn test_evm_anchoring() -> Result<()> { | ||
| tracing_subscriber::fmt() |
Collaborator
There was a problem hiding this comment.
you can use #[test_log::test(tokio)] to automatically set up tracing and use those macros instead of println!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add new crate implementing EVM blockchain anchoring for Ceramic streams.